package solutions.leetcode.easy

/**
 * @author lizhidong
 * <a href="https://leetcode.cn/problems/count-asterisks/">2315. 统计星号</a>
 */
private class Solution2315 {
    fun countAsterisks(s: String): Int {
        var c = 0
        var h = 1
        for (item in s) {
            when (item) {
                '|' -> h = 1 - h
                '*' -> c += h
            }
        }
        return c
    }
}

fun main() {

}